//
//  ZZCSongDescriptionView.m
//  B段项目
//
//  Created by dllo on 15/12/22.
//  Copyright © 2015年 张智超. All rights reserved.
//

#import "ZZCSongDescriptionView.h"

@interface ZZCSongDescriptionView ()<UIWebViewDelegate>

@property(nonatomic,retain)UIWebView *webView;

@end

@implementation ZZCSongDescriptionView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView{
    self.backgroundColor = [UIColor whiteColor];
    
    
    self.webView = [[UIWebView alloc]init];
    [self addSubview:self.webView];
    self.webView.delegate = self;
    [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.left.mas_equalTo(0);
        make.width.equalTo(self.mas_width);
        make.height.equalTo(self.mas_height);
    }];
    
    
    _webView.scrollView.bounces = NO;
    
}


-(void)setWebUrl:(NSString *)webUrl{
    NSURL *url = [NSURL URLWithString: webUrl];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
